package com.example.p05one2onemapsid;

import lombok.*;

import javax.persistence.*;

@Entity
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@ToString(exclude = "user")
public class UserInfo {
    @Id
    //不需要生成方法
    private Long id;

    private Integer age;
    private String phone;

    @MapsId
    @OneToOne(cascade = {CascadeType.PERSIST}, orphanRemoval = true)
    private User user;
}
